package com.itheima.demo7_super关键字.p03构造方法;

public class Test {
    public static void main(String[] args) {
        Zi zi = new Zi(10,999);
        zi.show();
    }
}
class Fu{
    int fuNum;

    public Fu() {
        System.out.println("Fu 无参构造");
    }

    public Fu(int fuNum) {
        this.fuNum = fuNum;
        System.out.println("Fu 满参构造");
    }
}
class Zi extends Fu{

    int ziNum;

    //无参构造
    public Zi() {
        System.out.println("Zi 无参构造");
    }

    //有参构造
    public Zi(int ziNum) {
        this.ziNum = ziNum;
        System.out.println("Zi 有参构造");
    }

    //满参构造
    public Zi(int fuNum, int ziNum) {
        //super.fuNum = fuNum;//可以这样操作，不够高级(专业)。
        super(fuNum);
        this.ziNum = ziNum;
        System.out.println("Zi 满参构造");
    }


    public void show() {
        System.out.println(fuNum + "," + ziNum);
    }
}